package com.sztx.pay.center.dataaccess.dao.mysql;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.sztx.pay.center.dataaccess.domain.OrderB2cDO;
import com.sztx.pay.center.dataaccess.domain.OrderB2cDumpDO;
import com.sztx.pay.center.dataaccess.entity.QueryOrder;
import com.sztx.se.dataaccess.mysql.BaseMysqlDAO;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface OrderB2cMysqlDAO extends BaseMysqlDAO<OrderB2cDO>  {
    
	  Integer save(OrderB2cDO orderB2cDO);
	  
	  void delete(@Param("tradeOrderId") String tradeOrderId);
	  
	  int updateInfo(OrderB2cDO orderB2cDO);
	  
	  OrderB2cDO findById(@Param("tradeOrderId") String tradeOrderId);
	  
	  OrderB2cDO findByIdForSchedule(@Param("tradeOrderId") String tradeOrderId);
	  
	  OrderB2cDO findByOrderId(@Param("orderId") String orderId);
	  
	  OrderB2cDO findByOrderIdAndId(@Param("tradeOrderId") String tradeOrderId, @Param("orderId") String orderId);

//    OrderB2cDO listPage(@Param("orderB2cDO") OrderB2cDO orderB2cDO, @Param("pageQuery") PageQuery pageQuery);
//
//    
//
//    Integer listCount(@Param("orderB2cDO") OrderB2cDO orderB2cDO);
	  
	  OrderB2cDO findLastOrderByUserId(@Param("userId") String userId);
	  
	  List<OrderB2cDO> findQuery(@Param("query") QueryOrder query, @Param("pageQuery") PageQuery pageQuery);
	  
	  Integer totalCount(QueryOrder queryOrder);
	  
	  Integer dumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	  
	  OrderB2cDO findOrderByPayParams(@Param("orderId")String orderId,@Param("amount") int amount,@Param("payerUserId") String payerUserId,@Param("bankId") String bankId);
	  
	  List<OrderB2cDumpDO> findUnHandleForSchedule(@Param("taskItemNum") Integer taskItemNum, @Param("taskItems") List<String> taskItems, @Param("fetchNum") Integer fetchNum, @Param("startTime") String startTime, @Param("endTime") String endTime);
	  
	  int updateHandleForSchedule(@Param("tradeOrderId") String tradeOrderId, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
	  
	  void deleteDumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	  
	  int batchUpdateHandleForSchedule(@Param("tradeOrderIds") List<String> tradeOrderIds, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
}